<template>
  <div class="f-loading__mask" v-show="show">
    <div class='mb-20px f-loading__icon'>
      <div class="round1"></div>
      <div class="round2"></div>
      <div class="round3"></div>
    </div>
    <p>加载中 . . .</p>
  </div>
</template>

<script setup lang="ts">
const props = defineProps({
  show: {
    type: Boolean,
    default: false
  }
})
</script>

<style lang="less" scoped>
.f-loading {
  &__mask {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1011;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    opacity: 0.7;
    color: rgb(25, 137, 250);
  }

  &__icon {
    width: 100px;
    text-align: center;


    .round1 {
      -webkit-animation-delay: -0.32s;
      animation-delay: -0.32s;
    }

    .round2 {
      -webkit-animation-delay: -0.16s;
      animation-delay: -0.16s;
    }
  }

  &__icon>div {
    width: 10px;
    height: 10px;
    background-color: rgb(25, 137, 250);
    margin-right: 8px;
    border-radius: 100%;
    display: inline-block;
    -webkit-animation: bouncedelay 1.4s infinite ease-in-out;
    animation: bouncedelay 1.4s infinite ease-in-out;
    /* Prevent first frame from flickering when animation starts */
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
  }
  @-webkit-keyframes bouncedelay {

    0%,
    80%,
    100% {
      -webkit-transform: scale(0.0)
    }

    40% {
      -webkit-transform: scale(1.0)
    }
  }

  @keyframes bouncedelay {

    0%,
    80%,
    100% {
      transform: scale(0.0);
      -webkit-transform: scale(0.0);
    }

    40% {
      transform: scale(1.0);
      -webkit-transform: scale(1.0);
    }
  }
}
</style>
